All Functions of Week 8

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

c

{base}

Combine values/vectors into a vector

as.character

{base}

Coerce a vector to character

factor

{base}

Create a factor

mean

{base}

Get mean of a vector

spread

{tidyr}

Spread a key-value pair across multiple columns

read_dta

{haven}

Read a .dta file (Stata data)

separate

{dplyr}

Separate a character column into multiple columns

sum

{base}

Get sum of numeric values or a vector

ifelse

{base}

Return a or b depending on the value of test

n

{dplyr}

The number of observations in the current group.

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

write.csv

{utils}

write a csv file to a data frame

write_dta

NA

desc

{dplyr}

Arrange in descending order

is.na

{base}

Check if a value is NA/elements of vector are NA

slice

{dplyr}

Subset rows using their positions

save

{base}

Writes an external representation of R objects to the specified file.

library

{base}

Load an R package

summarize

NA

recode

{dplyr}

Recode a variable

data.frame

{base}

Create a data.frame from vectors

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

select

{dplyr}

Select columns from a tibble/data frame

as.numeric

{base}

Coerce a vector to numeric

cut

{base}

Convert Numeric to Factor

setwd

{base}

Set Working Directory

filter

{dplyr}

Filter out rows of a data frame according to logical vector

mutate

{dplyr}

Modify/create a column in a data frame

ordered

{dplyr}

Create an ordered factor

The end!